package com.zqweb.gulimall.authserver.vo;

import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

@Data
@ToString
// 用户注册提交的表单信息封装vo
public class UserRegistVo {
    @NotEmpty(message = "用户名必须填写！")
    @Length(min = 4,max = 20,message = "用户名必须是4-20位字符！")
    private String userName;// 用户名
    @NotEmpty(message = "密码必须填写！")
    @Length(min = 6,max = 20,message = "密码必须是6-20位字符")
    private String password;// 密码
    @NotEmpty(message = "手机号必须填写！")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$",message = "手机号码格式不正确！")
    private String phoneNumber;// 手机号
    @NotEmpty(message = "校验码必须填写！")
    private String code;// 校验码

}
